package com.sinaapp.mspring.model.pojo;

import java.util.Date;
import java.util.UUID;

import org.springframework.util.StringUtils;

public class User {

	private String id;
	
    private String loginname;

    private String nickname;

    private String email;

    private Date createdate;

    private byte[] password;

    private byte[] salt;

    public String getId() {
    	if(StringUtils.isEmpty(id)) {
    		UUID.randomUUID().toString().replace("-", "");
    	}
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getLoginname() {
        return loginname;
    }

    public void setLoginname(String loginname) {
        this.loginname = loginname == null ? null : loginname.trim();
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname == null ? null : nickname.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public Date getCreatedate() {
        return createdate;
    }

    public void setCreatedate(Date createdate) {
        this.createdate = createdate;
    }

    public byte[] getPassword() {
        return password;
    }

    public void setPassword(byte[] password) {
        this.password = password;
    }

    public byte[] getSalt() {
        return salt;
    }

    public void setSalt(byte[] salt) {
        this.salt = salt;
    }
}